package com.zxp.springcloud.controller;

import com.zxp.springcloud.entities.CommonResult;
import com.zxp.springcloud.entities.Payment;
import com.zxp.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @description:
 * @author: 张新朋
 * @time: 2020/5/6 9:40
 */
@RestController
@Slf4j
public class OrderFeignController {
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPayment(@PathVariable("id") Long id){
        return paymentFeignService.getPaymentById(id);
    }

    @GetMapping(value = "/consumer/payment/feignTimeout")
    public String getFeignTimeout() {
        return paymentFeignService.getFeignTimeout();
    }
}